<?php

class MemberArea extends Extension {
	function CurrentMember() {
        return Distributor::currentUser();
    }
	
    function getMemberArea(){
        $page = MemberAreaPage::get()->find('ClassName', 'MemberAreaPage');
		if($page && $page->hasExtension('Translatable') && $this->owner->Locale){
			$page = $page->getTranslation($this->owner->Locale);
		}
        return $page ? $page : null;
    }
    
    function getMemberAreaLink() {
        $page = $this->getMemberArea();
        return $page ? $page->Link() : null;
    }
}
